<?php 
	class Advertisings extends CI_Model{

	 	function __construct(){
        	parent::__construct();
    	}

		function get_list($conditions = array(), $limit = 10){
            $where = '1=1';
            if(!empty($conditions['ad_position_sign'])){
                $where .= " AND ad_position_sign = '{$conditions['ad_position_sign']}'";
            }
            if(!empty($conditions['school_id'])){
                $where .= " AND school_id = '{$conditions['school_id']}'";
            }
            $sql = "SELECT SQL_CALC_FOUND_ROWS * FROM {$this->db->dbprefix}advertising WHERE $where AND status=1 ORDER BY sort ASC LIMIT $limit";
            $result = $this->db->query($sql)->result_array();
            return $result;
        }
    }